#include "cppTutorConstructorChaining.h"

#include <iostream>

using namespace std;

CcppTutorConstructorChaining :: CcppTutorConstructorChaining ()
{
	m_CcppTutorConstructorChaining ();
}

CcppTutorConstructorChaining :: ~CcppTutorConstructorChaining ()
{
	//cout << "Freeing Memory" << endl;
	delete m_npValue;
}

void CcppTutorConstructorChaining :: m_CcppTutorConstructorChaining()
{
	//cout << "Performing Default constructor Job !!!" << endl;
	m_nValue = 0;
	
	//cout << "Initalizing Memory" << endl;
	m_npValue = new int;
}

void CcppTutorConstructorChaining :: m_CCPerformTask ()
{
	char ch = '\0';
	cout << "Enter a value : ";
	cin >> m_nValue;

	if (m_nValue > 10)
	{
		cout << "Do you want to reset the value entered ????, [Y/y]]" << endl;
		cin >> ch;
		if ( ch == 'Y' || ch == 'y')
		{
			m_CcppTutorConstructorChaining ();
		}
	}
	else
	{
		cout << "Happy to work with you !!!!" << endl;
	}
}
